<div ng-init="init();" class="kmi-layout-content SMT19-content">
    <!-- SMT產品與Panel序號生成列印  -->
    <div class="kmi-header-row">
        <div class="kmi-side-btn left" ng-click="back();">
            <i class="material-icons">&#xE408;</i>
            <div class="kmi-can-click"></div>
        </div>
        <div class="header-title" ng-bind="'SMT19.title' | translate"></div>
        <div class="header-logo"></div>
    </div>
    <div class="kmi-layout-main-content">
        <div class="kmi-layout-page">
            <div class="kmi-text-fields">
                <label class="label" ng-bind="'SMT19.plot_no' | translate"></label>
                <input class="value" ng-model="condition.plot_no" style="flex: 0 0 70%;"></input>
                <div class="tip search" ng-click="loadPlotList();"><img src="image/icons/search.png"></img> </div>
                <div class="serial-no-state" style="flex: 1;">
                </div>
                <!-- 搜尋舊號 -->
                <div class="kmi-button kmi-button-confrim" style="width:100px" ng-click="search()">
                    <label ng-bind="'SMT19.btn.search_old_No' | translate"></label>
                    <div class="kmi-can-click"></div>
                </div>
            </div>
            <div class="kmi-text-fields">
                <label class="label" ng-bind="'SMT19.serial_no' | translate"></label>
                <div class="serial-no-input" style="flex: 0 0 70%;">
                    <input class="value" ng-model="condition.serial_number_start"></input>
                    <label class="label">~</label>
                    <input class="value" ng-model="condition.serial_number_end"></input>
                </div>
                <div class="serial-no-state" style="flex: 1;"></div>
                <!-- 生成新號 -->
                <div class="kmi-button kmi-button-confrim" style="width:100px" ng-click="generate_new_code()">
                    <label ng-bind="'SMT19.btn.generate_new_No' | translate"></label>
                    <div class="kmi-can-click"></div>
                </div>
            </div>
            
            <div class="kmi-text-fields" style="margin-top: 4px;">
                <div class="kmi-text-fields" style="margin-right: 30px;flex: 0 0 160px; justify-content: space-between;">
                    <button class="mdl-button mdl-js-button kmi-checkbox" ng-click="switch_serial_type('PCSNO')" style="padding-top: 2px;flex: 1;">
                        <img ng-src="{{condition.serial_type=='PCSNO'?'image/icons/check1.png':'image/icons/check0.png'}}">
                        {{'SMT19.lot_no' | translate}}
                    </button>
                    <button class="mdl-button mdl-js-button kmi-checkbox" ng-click="switch_serial_type('PANELNO')" style="padding-top: 2px;flex: 1;">
                        <img ng-src="{{condition.serial_type=='PANELNO'?'image/icons/check1.png':'image/icons/check0.png'}}">
                        {{'SMT19.panel_no' | translate}}
                    </button>
                </div>
                <!-- 序號數量 -->
                <div class="kmi-text-fields" style="margin-right: 10px;">
                    <label class="label" ng-bind="'SMT19.lot_no_num' | translate"></label>
                    <input class="value" ng-model="condition.lot_no_num" style="flex:1;"></input>
                </div>
                <!-- 連版數 -->
                <div class="kmi-text-fields">
                    <label class="label" ng-bind="'SMT19.consecutive_panel_num' | translate"></label>
                    <input class="value" ng-model="condition.pcs_on_per_panel" style="flex:1;"></input>
                </div>
            </div>
            <div class="kmi-list column-selector" style="border-radius: 0 0 6px 6px;">
                <div class="kmi-list__header">
                    <div class="kmi-list__column" style="flex:0 0 40px">
                        <button class="mdl-button mdl-js-button mdl-button--icon" ng-click="selectAll();">
                            <img ng-src="{{isSelectAll?'image/icons/check1.png':'image/icons/check0.png'}}"></img>
                        </button>
                    </div>
                    <!-- 標籤列印次數 -->
                    <div class="kmi-list__column" style="flex: 1;" ng-bind="'SMT19.list.number_of_label_print' | translate"></div>
                    <div class="kmi-list__column" style="flex: 1;" >
                        <!-- 成品版號 -->
                        <label ng-bind="'SMT19.list.panel_no' | translate" ng-show="condition.serial_type === 'PANELNO'"></label>
                        <!-- 成品序號 -->
                        <label ng-bind="'SMT19.list.serial_no' | translate" ng-show="condition.serial_type === 'PCSNO'"></label>
                    </div>
                    <!-- 連板號 -->
                    <div class="kmi-list__column" style="flex: 1;" ng-bind="'SMT19.list.panelization' | translate"></div>
                </div>
                <div class="kmi-list__row-content">
                    <div class="kmi-list__row" ng-repeat="item in pcs_detail track by $index">
                        <div class="kmi-list__column" style="flex:0 0 40px;">
                            <button class="mdl-button mdl-js-button mdl-button--icon" ng-click="itemClick(item, $index);">
                                <img ng-src="{{item.isSelect=='true'?'image/icons/check1.png':'image/icons/check0.png'}}"></img>
                            </button>
                        </div>
                        <!-- 標籤列印次數 -->
                        <div class="kmi-list__column" style="flex: 1;" ng-bind="item.print_label_num"></div>
                        <div class="kmi-list__column" style="flex: 1;"> 
                            <!-- 成品序號 -->
                            <label ng-bind="item.pcs_no" ng-show="condition.serial_type === 'PCSNO'"></label>
                            <!-- 成品版號-->
                            <label ng-bind="item.panel_no" ng-show="condition.serial_type === 'PANELNO'"></label>
                        </div>
                        <!-- 連板號 -->
                        <div class="kmi-list__column" style="flex: 1;">
                            <label ng-show="condition.serial_type === 'PCSNO'"></label>
                            <label ng-bind="item.pcs_on_per_panel" ng-show="condition.serial_type === 'PANELNO'"></label>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="kmi-layout-footer">
            <button class="mdl-button mdl-js-button mdl-button--fab mdl-shadow--custom mdl-button--custom1"
            ng-click="confirm();" ng-disabled="!pcs_detail || pcs_detail.length==0">
              <i class="material-icons">done</i>
            </button>
        </div>
    </div>
</div>
